import request from '../utils/request'

export function articleListByClassifications (classifications) {
  return request({
    url: '/article/subscriber/classifications',
    method: 'get',
    params:
      {
        classifications: classifications + ''
      }
  })
}

export function articleListByLabels (labels) {
  return request({
    url: '/article/subscriber/labels',
    method: 'get',
    params:
      {
        labels: labels + ''
      }
  })
}

export function articleDraft (article) {
  return request({
    url: '/article/draft',
    method: 'post',
    data: article
  })
}

export function articleRelease (article) {
  return request({
    url: '/article/release',
    method: 'post',
    data: article
  })
}

export function articleById (articleId) {
  return request({
    url: `/article/${articleId}`,
    method: 'get'
  })
}

export function articleByHeadline (headline) {
  return request({
    url: `/article/headline?headline=${headline}`,
    method: 'get'
  })
}

export function articleRecommend (query) {
  return request({
    url: '/article/recommend',
    method: 'get',
    params: query
  })
}
